import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-09-29
 * Time: 11:14
 */
import java.util.Scanner;

public class Main3{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int c = in.nextInt();
        IntegerDigitSum ids = new IntegerDigitSum();
        int result = ids.getDigitSum(c);
        System.out.printf("%d\n", result);
    }
}

class IntegerDigitSum {
    public int getDigitSum(int c){
        int s=0;
        if(c<0){
            c=-c;
        }
        while (c>0){
            s+=c%10;
            c/=10;
        }
        return s;
    }
}


